Array.prototype.remove = function (dx) {
    if (isNaN(dx) || dx > this.length) {
        return false;
    }
    for (var i = 0, n = 0; i < this.length; i++) {
        if (this[i] != this[dx]) {
            this[n++] = this[i];
        }
    }
    this.length -= 1;
};

//字符串以str开头
String.prototype.startWith = function (str) {
    var reg = new RegExp('^' + str);
    return reg.test(this);
};
//字符串以str结尾
String.prototype.endWith = function (str) {
    var reg = new RegExp(str + '$');
    return reg.test(this);
};